
var url = require('url');

const myURL = url.parse('https://user:pass@sub.host.com:8080/p/a/t/h?test=string#hash');

function printURL() {
	let urlInfo = '';
	urlInfo += myURL.protocol + '|';
	urlInfo += myURL.auth + '|';
	urlInfo += myURL.host + '|';
	urlInfo += myURL.path + '|';
	console.log(urlInfo);
}

printURL();

console.log(myURL.pathname);
console.log(myURL.search);

var params = myURL.query;
console.log(params.test);
